package com.whfc.iot.mach.entity;

import com.google.common.base.Objects;

/**
 * @Description: 硬件升级本地缓存key
 * @author: xugcheng
 * @version: 1.0
 * @date: 2021-06-24 14:48
 */
public class UpgradeCacheKey {

    private Integer deviceType;

    private Integer deviceId;

    private String masterVer;

    private String slaveVer;

    public UpgradeCacheKey(Integer deviceType, Integer deviceId, String masterVer, String slaveVer) {
        this.deviceType = deviceType;
        this.deviceId = deviceId;
        this.masterVer = masterVer;
        this.slaveVer = slaveVer;
    }

    public Integer getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(Integer deviceType) {
        this.deviceType = deviceType;
    }

    public Integer getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Integer deviceId) {
        this.deviceId = deviceId;
    }

    public String getMasterVer() {
        return masterVer;
    }

    public void setMasterVer(String masterVer) {
        this.masterVer = masterVer;
    }

    public String getSlaveVer() {
        return slaveVer;
    }

    public void setSlaveVer(String slaveVer) {
        this.slaveVer = slaveVer;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UpgradeCacheKey that = (UpgradeCacheKey) o;
        return Objects.equal(deviceType, that.deviceType) &&
                Objects.equal(deviceId, that.deviceId) &&
                Objects.equal(masterVer, that.masterVer) &&
                Objects.equal(slaveVer, that.slaveVer);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(deviceType, deviceId, masterVer, slaveVer);
    }
}
